package www.wxwnb.clerk.application;

import android.content.Context;
import android.text.TextUtils;
import android.util.Log;

import cn.jpush.android.api.JPushInterface;
import www.wxwnb.clerk.base.BaseApplication;
import www.wxwnb.clerk.utils.Customer;

import static android.R.attr.id;

/**
 * Created by lenovo on 2017/9/11.
 */

public class MyApplication extends BaseApplication {

    private static Context mContext;

    @Override
    public void onCreate() {
        super.onCreate();
        mContext = getApplicationContext();
        JPushInterface.setDebugMode(false);    // 设置开启日志,发布时请关闭日志
        JPushInterface.init(this);            // 初始化 JPush

        String id = Customer.getInstance().getUserId();
        if (!TextUtils.isEmpty(id)) {
            String alias = "clerk" + id;
            Log.i("alias", alias);
            JPushInterface.setAlias(this, alias, null);
        }

    }

    public static Context getContext() {
        return mContext;
    }
}
